package com.demo;

/**
 * 贯穿整个application的常量对象
 *
 * @author ryuu.kk
 */
public final class Constants {

    private Constants() {
        // hide me
    	//com.demo.webapp.views.freemarker.FreemarkerManagerEx
    	//com.demo.cms.action.manage.FormAction
    }
    
    //~ Static fields/initializers =============================================

    // application配置信息：见WEB-INF/info.properties
    /**
     * 当前应用名
     */
    public static final String APP_NAME = "app.name";
    /**
     * 当前应用版本号
     */
    public static final String APP_VERSION = "app.version";
    
    /**
     * 当前应用授权
     */
    public static final String APP_LICENSE = "app.license";
    
    /**
     * 当前application的ResourceBundle名称
     */
    public static final String BUNDLE_KEY = "globalMessage"; //"ApplicationResources";

    /**
     * 从系统属性中查找文件分隔符
     * File separator from System properties
     */
    public static final String FILE_SEP = System.getProperty("file.separator");

    /**
     * 从系统属性中查找用户空间
     * User home from System properties
     */
    public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;

    /**
     * 模板存储相对路径
     */
    public static final String TEMPLATE_HOME = "template/";
    
    /**
     * 缓存存储相对路径
     */
    public static final String CACHE_HOME = "";

    /**
     * Session scope attribute that holds the locale set by the user. By setting this key
     * to the same one that Struts uses, we get synchronization in Struts w/o having
     * to do extra work or have two session-level variables.
     */
    public static final String PREFERRED_LOCALE_KEY = "org.apache.struts2.action.LOCALE";

    /**
     * The request scope attribute under which an editable user form is stored
     */
    public static final String USER_KEY = "userForm";

    /**
     * The request scope attribute that holds the user list
     */
    public static final String USER_LIST = "userList";

    /**
     * The request scope attribute for indicating a newly-registered user
     */
    public static final String REGISTERED = "registered";

    /**
     * The name of the Administrator role, as specified in web.xml
     */
    public static final String ADMIN_ROLE = "ROLE_ADMIN";

    /**
     * The name of the User role, as specified in web.xml
     */
    public static final String USER_ROLE = "ROLE_USER";

    /**
     * The name of the user's role list, a request-scoped attribute
     * when adding/editing a user.
     */
    public static final String USER_ROLES = "userRoles";

    /**
     * The name of the available roles list, a request-scoped attribute
     * when adding/editing a user.
     */
    public static final String AVAILABLE_ROLES = "availableRoles";

    /**
     * CSS主题名设置(通过该名称查找对应主题).
     */
    public static final String CSS_THEME = "csstheme";
    
    //~~============================================================================
    
    /**
     * 自定义表单的前缀
     * 自定义表单的name组成:FORM_ITEM_PREFIX + ID
     */
    public static final String FORM_ITEM_PREFIX = "_item_";
    
    /**
     * Struts Menu的配置名称
     */
    public static final String MENU_CONFIG_NAME = "struts-menu";
    
    /**
     * 公共目录的唯一标示符
     * 通过该标示获取公共目录
     */
    public static final String PUBLISH_FOLDER_UUID = "9de4fad46e774f7182b265b3a70c3e5c";
    
    /**
     * 站点域名
     * 域名注册后,使用全称
     */
    public static final String SITE_DOMAIN = "cms";
    
    // ~~ 模板类型 -----------------------------------------------------------------------------
	/**
	 * 模板类型:频道首页模板
	 */
	public static final String TYPE_CHANNEL = "channel";
	/**
	 * 模板类型:栏目首页模板
	 */
	public static final String TYPE_CATEGORY = "category";
	/**
	 * 模板类型:文章模板
	 */
	public static final String TYPE_ARTICLE = "article";
	/**
	 * 模板类型:其他模板
	 */
	public static final String TYPE_OTHER = "other";
	
	// ~~ 基础配置的固定主键ID
	/**
	 * 配置国际化的
	 * 已删除,参照CONFIG_I18N,使用name作为固定Key
	 */
	@Deprecated
	public static final Long CONFIG_I18N_KEY = 5L;
	
	/**
	 * 功能树的根节点
	 */
	public static final Long FUNCTION_ROOT_ID = 1L;
	
	// ~~ 一些自定义表单项的属性名====================================================
	/**
	 * 自定义表单的分组Group: 0 有实体表对应
	 */
	public static final int FORM_GROUP_NORMAL = 0;
	
	/**
	 * 自定义表单项的分组Group:1 无实体表对应(扩展)
	 */
	public static final int FORM_GROUP_EXTEND = 1;
	
	
    // ~~ 一些配置相关的属性名========================================================
	/**
	 * 配置文章类型的Key
	 * T_CORE_CONFIG中存储文章类型-自定义文章关联关系
	 */
	public static final String CONFIG_ARTICLE_TYPE = "ARTICLE_TYPE";
	// 配置表单项(文章-表单ID)对应的KEY
	public static final String CONFIG_ARTICLE_FORM_ID = "ARTICLE_FORM_ID";
	// ~~ 文章自定义表单项的一些扩展属性KEY
	// 宽
	public static final String FORM_ARTICLE_ITEM_WIDTH = "FORM_ITEM_WIDTH";
	// 高
	public static final String FORM_ARTICLE_ITEM_HEIGHT = "FORM_ITEM_HEIGHT";
	// 输入长度
	public static final String FORM_ARTICLE_ITEM_LENGTH = "FORM_ITEM_LENGTH";
	// 验证(正则)
	public static final String FORM_ARTICLE_ITEM_VALIDATE = "FORM_ITEM_VALIDATE";
	
	/**
     * 站点配置国际化语言的Key
     */
    public static final String CONFIG_I18N = "SITE_I18N";
    
    /**
     * 站点配置的email信息
     * 站点可有配置的Email地址向外发送系统邮件
     */
    public static final String CONFIG_EMAIL = "SITE_EMAIL";
    // 站点配置email信息：字符集字段
    public static final String CONFIG_EMAIL_CHARSET = "SITE_EMAIL_CHARSET";
    // 站点配置email信息：邮件服务器
    public static final String CONFIG_EMAIL_SMTP = "SITE_EMAIL_SMTP";
    // 站点配置email信息：邮箱账号
    public static final String CONFIG_EMAIL_ACCOUNT = "SITE_EMAIL_ACCOUNT";
    // 站点配置email信息：邮箱登录名
    public static final String CONFIG_EMAIL_USERNAME = "SITE_EMAIL_USERNAME";
    // 站点配置email信息：邮箱密码
    public static final String CONFIG_EMAIL_PASSWORD = "SITE_EMAIL_PASSWORD";
    
	// ~~ 文章评论相关Key  =====================================================
    /**
     * 站点是否支持匿名评论Key
     */
    public static final String ARTICLE_REPLY_ANONYMOUS = "ANONYMOUS_REPLY";
    
    /**
     * 评论是否需要check的Key
     */
    public static final String ARTICLE_REPLY_CHECKED = "REPLY_CHECK";
    
    /**
	 * 用户默认昵称
	 */
	public static final String USER_DEFAULT_NICK_NAME = "匿名用户";
	
	/**
	 * 批量会员默认昵称
	 */
	public static final String MEMBER_DEFAULT_NICK_NAME = "匿名会员";
	
	// ~~ 文章扩展属性Key: 图片部分 =====================================================
	/**
	 * 文章缩略图
	 */
	public static final String ARTICLE_IMG_THUMBNAIL = "IMG_THUMBNAIL";
	
	/**
	 * 文章中等图片
	 */
	public static final String ARTICLE_IMG_MEDIUM = "IMG_MEDIUM";
	
	/**
	 * 文章原始图(640X480/1024X768)
	 */
	public static final String ARTICLE_IMG_ORIGINAL = "IMG_ORIGINAL";
	
	/**
	 * 缩略图前缀
	 */
	public static final String IMAGE_THUMB_PREFIX = "______thumb_";
	
	/**
	 * 中图前缀
	 */
	public static final String IMAGE_MEDIUM_PREFIX = "______medium_";
	
	/* **************************************************
	 *  ~~ Action类型： 使模板得到相应的类型进行处理 
	 *  CMS中有四个Action:频道、栏目、文章、检索
	 *************************************************** */
	/**
	 * 文章Action
	 */
	public static final String ACTION_TYPE_ARTICLE = "article";
	
	/**
	 * 栏目Action
	 */
	public static final String ACTION_TYPE_CATEGORY = "category";
	
	/**
	 * 频道Action
	 */
	public static final String ACTION_TYPE_CHANNEL = "channel";
	
	/**
	 * 检索Action
	 */
	public static final String ACTION_TYPE_SEARCH = "search";
	

	/**
	 * Channel默认Action名称
	 */
	public static final String CMS_CHANNEL_DEFAULT = "index";
}
